<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		   <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
           <meta name="author" content="Zhang Cheng">
		<title></title>
		<script src="js/vue.js" ></script>
		 <!-- 注意：vue-resource 依赖于 Vue，所以先后顺序要注意  -->
  		 <!-- this.$http.jsonp -->
		<script src="js/vue-resource-1.3.4.js">
			
		</script>
	</head>
	<body>
		<div id="app">
			<input type="button" id="" value="get请求" @click="getInfo"/>
			<div v-for="item in list">
				<p>{{item.name}}</p>
			</div>
			
		</div>
		<script>
			var app = new Vue({
				el:'#app',
				data:{
					list:'',
				},
				methods:{
					getInfo(){
						//通过get发起网络请求，通过then 获取成功回调
						this.$http.get('json/list.json').then( function success(result){
							this.list = result;
							console.log(this.list)
						},function error(){
							
						})
					},
				}
			});
		</script>
	</body>
</html>